/**
 * Copyright (c) 2021 XuSaisai
 * ArcProgressStackViewJS is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *          http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

export class Model {
    title= "";
    lastProgress= 0.0;
    progress= 0.0;
    color= "";
    bgColor= "";
    radius=0;

    constructor(title, progress, progressColor, bgColor) {
        this.title = title;
        this.bgColor = bgColor,
        this.color = progressColor;
        this.setProgress(progress);
    }

    setProgress(progress) {
        this.lastProgress = this.progress;
        this.progress = Math.max(0, Math.min(progress, 100));
    }
}